--*************ANIMATION SUITE****************--
--**************Property of Hxrmn*****************--
--*************Hxrmn@comcast.net*****************--
--DO NOT RE-DISTRIBUTE WITHOUT HXRMN'S CONSENT--
--********************************************--

Property = {}

function Property:Create(Id, Entity, Setter, Value)
	local prop = {}
	setmetatable(prop, self)
	self.__index = self
	prop.setter = Setter
	prop:SetEntity(Entity)
	prop:SetValue(Value)
	prop.id = Id;
	
	return prop
end

function Property:Apply()
	local ent = self.entity
	if(ent != nil and ent:IsValid()) then
		local set = self.setter
		local b, e = pcall(set,ent,self:GetValue())
		if ( !b ) then
			Error("SetProperty Error: "..tostring(e).."\n")
		end
	end
end

function Property:GetValue()
	return self.value
end

function Property:SetValue(value)
	self.value = value
end

function Property:GetEntity()
	return self.entity
end

function Property:SetEntity(entity)
	self.entity = entity
end

function Property:GetId()
	return self.id
end